then

abstract fun then(onFulfilled: JsPromiseHandler, onRejected: JsPromiseHandler): JsPromise

Registers fulfillment and rejection handlers for this promise and returns a new one.

The appropriate handler is called immediately if the promise is already settled.

Parameters

onFulfilled

a handler that is invoked if the promise is fulfilled

onRejected

a handler that is invoked if the promise is rejected

See also

Throws

if the JavaScript promise is already disposed


abstract fun then(onFulfilled: JsPromiseHandler): JsPromise

Registers a fulfillment handler for this promise and returns a new one.

The handler is called immediately if the promise is already fulfilled.

Parameters

onFulfilled

a handler that is invoked if the promise is fulfilled

See also

Throws

if the JavaScript promise is already disposed